<template>
  <div class="father">
    父亲
    <div>父亲的房产 {{ house }}</div>
    <button @click="getSon($refs)">获取所有儿子</button>
    <son1 ref="c1"/>
    <son2 ref="c2"/>
  </div>
</template>

<script setup lang="ts">
  import son1 from "@/components/test/_12/son1.vue";
  import son2 from "@/components/test/_12/son2.vue";
  import {onMounted, ref} from "vue";

  const c1 = ref();
  const c2 = ref();
  const house = ref<number>(4);

  function getSon(refs : {[key: string]: any}) {
    for (let key in refs) {
      console.log(refs[key]);
    }

  }

  defineExpose({
    house
  })
</script>

<script lang="ts">
/**
 * @Author Rin_pu
 * @Date 2025/2/21 14:43
 * @Description father
 * @todo
 */
export default {
  name: "father.vue"
}
</script>

<style scoped>
  .father {
    background-color: gray;
    margin: 10px;
    width: 800px;
    height: 500px;
  }
</style>